package april.test_4_20;

import java.util.Scanner;

public class TestMain4 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        scanner.nextLine();
        String str = scanner.nextLine();
        char[] arr = str.toCharArray();
        for (int  i = 0; i < n - k && i < arr.length; i ++) {
            swap(arr,i,i+k - 1);
        }
        System.out.println(new String(arr));
    }
    private static void  swap(char[] chars,int start,int end) {
        while (start < end) {
            char tmp = chars[start];
            chars[start] = chars[end];
            chars[end] = tmp;
            start++;
            end--;
        }
    }
}
